<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改健身房会员')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-member-edit" th:object="${gymMember}">
            <input name="memberId" th:field="*{memberId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">会员名：</label>
                <div class="col-sm-8">
                    <input name="memberName" th:field="*{memberName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">性别：</label>
                <div class="col-sm-8">
                    <select name="memberSex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{memberSex}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">会员手机号：</label>
                <div class="col-sm-8">
                    <input name="memberIphone" th:field="*{memberIphone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">教练：</label>
                <div class="col-sm-8">
                    <select id="coach" th:field="*{coachId}" class="form-control select2-multiple">
                        <option th:each="coach:${coaches}" th:value="${coach.coachId}" th:text="${coach.coachName}" th:selected="${coach.coachId==coachId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">地区：</label>
                <div class="col-sm-8">
                    <select id="region" th:field="*{regionId}" class="form-control select2-multiple">
                        <option th:each="region:${regiones}" th:value="${region.regionId}" th:text="${region.regionName}" th:selected="${region.regionId==regionId}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/member";
        $("#form-member-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-member-edit').serialize());
            }
        }
    </script>
</body>
</html>